package com.example.demo.service;

import com.example.demo.common.utils.UUIDUtil;
import com.example.demo.dao.QuestionEntityMapper;
import com.example.demo.dao.entity.QuestionEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class QuestionService {
    @Autowired
    private QuestionEntityMapper questionEntityMapper;

    public int addQuestionInfo(QuestionEntity questionEntity){
        questionEntity.setId(UUIDUtil.getOneUUID());
        int questionResult = questionEntityMapper.insert(questionEntity);
        return questionResult;
    }

    public int modifyQuestionInfo(QuestionEntity questionEntity){
        int questionResult = questionEntityMapper.update(questionEntity);
        return questionResult;
    }

    public int deleteQuestion(QuestionEntity questionEntity){
        int questionResult = questionEntityMapper.delete(questionEntity);
        return questionResult;
    }
}
